#include <iostream>
#include <vector>

using namespace std;

class Solution1 {
public:
    int mp[100010];

    vector<int> findOriginalArray(vector<int>& changed) {
        int n = changed.size();
        if (n & 1) return {};
        vector<int> res;
        int mx = changed[0]; int mn = changed[0];
        for (int x : changed)
        {
            mp[x]++;
            mx = max(mx, x); mn = min(mn, x);
        }
        int cnt = n;
        for (int i = mn; i <= mx; ++i)
        {
            if (mp[i])
            {
                if (i == 0)
                {
                    cnt -= mp[i];
                    if (mp[i] % 2) return {};
                    mp[i] /= 2;
                }
                else
                {
                    mp[2 * i] -= mp[i]; cnt -= 2 * mp[i];
                    if (mp[2 * i] < 0) return {};
                }
                while (mp[i]--) res.push_back(i);
            }
        }
        if (cnt) return {};
        return res;
    }
};

struct ListNode {
    int val;
    struct ListNode *next;
    ListNode(int x) : val(x), next(nullptr) {}
};
 
class Solution2 {
public:
    ListNode* reverseList(ListNode* head)
    {
        ListNode h(-1);
        ListNode* cur = head;
        while (cur)
        {
            ListNode* next = cur->next;
            cur->next = h.next;
            h.next = cur;
            cur = next;
        }
        return h.next;
    }

    ListNode* addInList(ListNode* head1, ListNode* head2) {
        head1 = reverseList(head1); head2 = reverseList(head2);
        ListNode res(-1);
        ListNode* cur1 = head1, * cur2 = head2; int add = 0;
        while (cur1 || cur2 || add)
        {
            int num1 = cur1 ? cur1->val : 0;
            int num2 = cur2 ? cur2->val : 0;
            int sum = num1 + num2 + add;
            add = sum / 10;
            ListNode* cur = new ListNode(sum % 10);
            cur->next = res.next;
            res.next = cur;
            if (cur1) cur1 = cur1->next;
            if (cur2) cur2 = cur2->next;
        }
        return res.next;
    }
};

int main()
{
    
    return 0;
}